//
//  ServiceCenterTableViewCell.m
//  DaiShengInvest
//
//  Created by 张睿 on 2017/6/30.
//  Copyright © 2017年 davinci. All rights reserved.
//

#import "ServiceCenterTableViewCell.h"


@interface ServiceCenterTableViewCell ()



@end



@implementation ServiceCenterTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    
    return self;
}


- (void)setupUI{
    
    self.backgroundColor = [UIColor clearColor];
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    
    self.titleLabel = [UILabel new];
    
    self.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    self.titleLabel.textColor = ColorWithRGB(0xd8d8d8);
    
    [self addSubview:self.titleLabel];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(15 * SCREENH6);
        make.top.mas_equalTo(self).offset(25 * SCREENH6);
    }];
    
    self.rightImageView = [UIImageView new];
    
    self.rightImageView.image = [UIImage imageNamed:@"修改头像"];
    
    [self addSubview:self.rightImageView];
    
    [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self).offset(-15 * SCREENH6);
        make.centerY.mas_equalTo(self.titleLabel);
        make.width.mas_equalTo(10 * SCREENH6);
        make.height.mas_equalTo(18 * SCREENH6);
    }];
    
    
    self.subTltleLabel = [UILabel new];
    
    self.subTltleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    self.subTltleLabel.textColor = ColorWithRGB(0xd8d8d8);
    self.subTltleLabel.textAlignment = NSTextAlignmentRight;
    
    [self addSubview:self.subTltleLabel];
    
    [self.subTltleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self.rightImageView.mas_leading).offset(-3 * SCREENH6);
        make.centerY.mas_equalTo(self.titleLabel);
    }];
    
    
    self.lineView = [UIView new];
    
    self.lineView.backgroundColor = [UIColor whiteColor];
    self.lineView.alpha = 0.1;
    
    [self addSubview:self.lineView];
    
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.bottom.mas_equalTo(self);
        make.height.mas_equalTo(1 * SCREENH6);
    }];
}



- (void)setModel:(CommonProblemModel *)model{
    
    _model = model;
    
    self.titleLabel.text = [NSString stringWithFormat:@"%@",model.title];
//    self.subTltleLabel.text = [NSString stringWithFormat:@"%@",model.content];
    self.ID = model.ID;
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
